<?php
session_start();
$captcha = imagecreatefromgif('cross.gif');

//set some variables
$black = imagecolorallocate($captcha, 0, 0, 0);
$white = imagecolorallocate($captcha, 225, 225, 225);
$red = imagecolorallocate($captcha, 225, 0, 0);
$font = 'arial.ttf';

//random stuff
$string = md5(microtime() * time());
$text = substr($string, 0, 6);
$_SESSION['code'] = $text;

//create some stupid stuff

imagettftext($captcha, 18, 5, 80, 25, $red, $font, $text);

// begin to create image
header('content-type: image/png');
imagepng($captcha);

//clean up
imagedestroy($captcha);



?>